/**
 * 作者：陈文斌 on 2019/1/7.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';
import 'package:crm/view/Tile/tile_normal.dart';

const TextStyle DetailTextStyle = TextStyle(
  color: AppColors.DetailTextColor,
  fontSize: AppFontSizes.Font14,
  fontFamily: AppFontFamilies.PingFangSC,
  fontWeight: FontWeight.w500,
);
const TextStyle PlaceholderTextStyle = TextStyle(
  color: AppColors.PlaceholderTextColor,
  fontSize: AppFontSizes.Font14,
  fontFamily: AppFontFamilies.PingFangSC,
  fontWeight: FontWeight.w500,
);

class ClientInfoTileSection extends StatelessWidget {
  final List<String> titles;
  final Map<String, String> contents;

  ClientInfoTileSection({
    Key key,
    @required this.titles,
    @required this.contents,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: Column(
        children: titles.map((title) {
          return TileNormal(
            title: Text(
              title ?? '',
              style: DetailTextStyle,
            ),
            subtitle: Expanded(
              child: Text(
                contents[title] ?? '',
                style: PlaceholderTextStyle,
              ),
            ),
          );
        }).toList(),
      ),
    );
  }
}
